package com.sanjin.service;

import com.sanjin.entity.ParkSpace;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.List;

/**
 * @description:
 * @author: sanjin
 * @date: 2019/5/5 23:06
 */
public interface ParkSpaceService {

    /**
     * 增
     * @param parkSpace
     * @return
     */
    ParkSpace createParkSpace(ParkSpace parkSpace);

    /**
     * delete
     * @param id
     */
    void deleteParkSpaceByParkSpaceId(Integer id);

    void deleteParkSpaceByParkSpaceIds(List<Integer> ids);

    /**
     * query
     * @param id
     * @return
     */
    ParkSpace queryParkSpaceByParkSpaceId(Integer id);

    /**
     * update
     * @param parkSpace
     * @return
     */
    ParkSpace updateParkSpace(ParkSpace parkSpace);


    Page<ParkSpace> queryParkSpaceByPage(PageRequest pageRequest);

    /**
     * 改变车位状态
     * @param parkSpaceId
     * @param status
     * @return
     */
    ParkSpace changeParkSpaceStatus(Integer parkSpaceId, Integer status);

    /**
     * 查找停车场下面所有的车位
     * @param parkLotId
     * @return
     */
    List<ParkSpace> queryParkSpacesByParkLotId(Integer parkLotId);


    void save(ParkSpace parkSpace);


    /**
     * 通过loraadd查找停车位
     * @param loraAddr
     * @return
     */
    ParkSpace queryParkSpaceByLoraAddr(String loraAddr);
}
